UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hUmyUvbWbcpnkLagk6E6dnQQzwykweTdYw9ADKaoATc='
WHERE
key_id = 'eae357e387d8ef4b9e458833ee4d3f2a882cc69091a8e0a8fc7f70b82ce2e21f'
AND (
token = 'hUmyUvbWbcpnkLagk6E6dnQQzwykweTdYw9ADKaoATc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)