UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fpS+hqUP69q3iluwS8MTnsp573mwN8IZFdVemMn6/XA='
WHERE
key_id = '1c2fb069fe6ec64597986151bc633cb7a0917a2d20badaa99222a977afd23e40'
AND (
token = 'fpS+hqUP69q3iluwS8MTnsp573mwN8IZFdVemMn6/XA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)