UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E7bsvAbe+Ejdtuh3+mPzR1U4JK3BhY7kbJKf/+8UkLo='
WHERE
key_id = 'dd78adb8e8857c0cb3903d1b2af03efc2f9b155c05374674b405f57e915d4914'
AND (
token = 'E7bsvAbe+Ejdtuh3+mPzR1U4JK3BhY7kbJKf/+8UkLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)