UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/mztlN38VwIgYKPiSd3lZBx9L29AHf9AodL8FKHWvcQ=' 
WHERE 
  key_id = '5975254adb82de49ceeaff8d4c88378bd805fc4952b5b7002b6db4b376452cf5' 
  AND (
    token = '/mztlN38VwIgYKPiSd3lZBx9L29AHf9AodL8FKHWvcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033