UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EfR6w3WamDmzeN+c3xieW861FSpS5bGqdiK/nYUHq4Y='
WHERE
key_id = 'a93c7b9646ec742f36cf40ab32e89e655de8319254aa940a011045c6108dca2a'
AND (
token = 'EfR6w3WamDmzeN+c3xieW861FSpS5bGqdiK/nYUHq4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)