UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5YBMJPoAPdGPHDsefp6we12cpFs6e14NZjowLEGbWp0='
WHERE
key_id = 'b5a156f0fedd949ba5316922bf46fac5caaee44c19a31c29bd2bd25aa31caccf'
AND (
token = '5YBMJPoAPdGPHDsefp6we12cpFs6e14NZjowLEGbWp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)