UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ybYD7zlpaySKQALV5hY/fERDm6IGsUe3t8TLqcaI/JA='
WHERE
key_id = '56847847289db7051dd4dbb46f716b5ba040eed05142c37810c70e375dd08347'
AND (
token = 'ybYD7zlpaySKQALV5hY/fERDm6IGsUe3t8TLqcaI/JA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)