UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3C3uDIu4HlsCtx9r2taQjd2lJAxi0DonW/+MnmO9Lg='
WHERE
key_id = '4c780a349f266fdcf0670c333ea7ba07f559901ef92d23090500c0f7dd3ce8c8'
AND (
token = 'e3C3uDIu4HlsCtx9r2taQjd2lJAxi0DonW/+MnmO9Lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)